//https://leetcode.cn/problems/fibonacci-number/submissions/
package codeRandomThoughts.Test509斐波那契数;

/**
 * 递归写法
 */
public class Solution2 {
    public int fib(int n) {
        //终止条件
        if (n < 2) return n;

        //单层递归
        return fib(n - 1) + fib(n - 2);
    }
}
